﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Business.Entity;
using Business.Dal;

namespace Sahibinden.UserAction
{
    public partial class MesajDetails : System.Web.UI.Page
    {
        Ilan ilan;
        Uye uye;
        Uye alici;
        Mesaj mesaj;
        protected void Page_Load(object sender, EventArgs e)
        {

            if (Request.QueryString.Get("MesajID") == null)
            {
                Response.End();
            }


            string MesajID = "0";
             MesajID = Request.QueryString.Get("MesajID");
            MesajProvider mp = new MesajProvider();
            mesaj = mp.MesajGetirByMesajID(Convert.ToInt32(MesajID));

            string IlanID = mesaj.IlanID.ToString();
            string GonderenID = Page.User.Identity.Name;
            UyeProvider uyep = new UyeProvider();
            uye = uyep.GetUyeGetirID(Convert.ToInt32(GonderenID));
            IlanProvider ip = new IlanProvider();
            ilan = ip.GetIlanByIlanID(Convert.ToInt32(IlanID));
            string AliciID = ilan.UyeID.ToString();
            alici = uyep.GetUyeGetirID(ilan.UlkeID);

            Label1.Text = ilan.IlanID.ToString();
            Literal1.Text = mesaj._Mesaj;

            LinkButton1.Text = ilan.IlanBasligi + " #(" + ilan.IlanID.ToString().PadLeft(10, '0') + ")";
            LinkButton1.PostBackUrl = "~/UserAction/IlaniListele.aspx?IlanID=" + ilan.IlanID.ToString();
        }
    }
}
